{{ define "admin/goodsTypeAttribute/index.html" }}
    {{ template "admin/common/page_header.html" .}}

    <div class="container-fluid p-t-15">
        <div class="row">
            <div class="col-lg-12">
                <div class="card">
                    <div class="card-header"><h4>类型:【{{.goodsType.Title}}】</h4></div>
                    <div class="card-toolbar d-flex flex-column flex-md-row">
                        <div class="toolbar-btn-action">
                            <a href="/admin/goodsTypeAttribute/add?cate_id={{.cateId}}" class="btn btn-primary">
                                <i class="mdi mdi-plus"></i>增加商品类型属性
                            </a>
                        </div>
                    </div>
                    <div class="card-body">
                        <table class="table table-bordered">
                            <thead>
                                <tr class="th">
                                    <th>属性名称</th>
                                    <th>商品类型</th>
                                    <th>属性值的录入方式</th>
                                    <th>可选值列表</th>
                                    <th>增加时间</th>
                                    <th class="text-center">排序</th>
                                    <th class="text-center">状态</th>
                                    <th class="text-center">操作</th>
                                </tr>
                            </thead>
                            <tbody>
                            {{$cateTitle := .goodsType.Title}}
                            {{range $key,$value := .goodsTypeAttributeList}}
                                <tr>
                                    <td>{{$value.Title}}</td>
                                    <td>{{$cateTitle}}</td>
                                    <td>
                                        {{if eq $value.AttrType 1}}
                                            单行文本框
                                        {{else if eq $value.AttrType 2}}
                                            多行文本框
                                        {{else if eq $value.AttrType 3}}
                                            select下拉框
                                        {{end}}
                                    </td>
                                    <td>{{$value.AttrValue}}</td>
                                    <td>{{UnixToTime $value.AddTime}}</td>
                                    <td>
                                        <span class="chSpanNum" data-id="{{$value.Id}}"
                                              data-table="goods_type_attribute" data-field="sort">{{$value.Sort}}</span>
                                    </td>
                                    <td class="text-center">

                                        {{if eq $value.Status 1}}
                                            <img src="/static/admin/images/yes.gif" class="chStatus"
                                                 data-id="{{$value.Id}}"
                                                 data-table="goods_type_attribute" data-field="status"/>
                                        {{else}}
                                            <img src="/static/admin/images/no.gif" class="chStatus"
                                                 data-id="{{$value.Id}}"
                                                 data-table="goods_type_attribute" data-field="status"/>
                                        {{end}}
                                    </td>

                                    <td class="text-center">
                                        <a href="/admin/goodsTypeAttribute/edit?id={{$value.Id}}">修改</a>
                                        <a class="delete" href="/admin/goodsTypeAttribute/delete?id={{$value.Id}}&cate_id={{$value.CateId}}">删除</a>
                                    </td>
                                </tr>
                            {{end}}
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>


{{end}}